package com.nervenets.general.enumeration;

import io.swagger.annotations.ApiModel;

@ApiModel("终端类型")
public enum Platform implements Enums {
    none("无"),
    h5("H5"),
    android("安卓"),
    ios("苹果"),
    management("管理后台"),
    desktop("PC桌面程序"),
    mac("Mac桌面程序"),
    website("网站程序"),
    androidPad("安卓平板"),
    iosPad("苹果平板"),
    miniApp("小程序"),
    ;

    private final String text;

    Platform(String text) {
        this.text = text;
    }

    public static Platform customValueOf(String name) {
        try {
            return Platform.valueOf(name);
        } catch (Exception e) {
            return Platform.none;
        }
    }

    @Override
    public String getText() {
        return text;
    }

    @Override
    public String getValue() {
        return this.name();
    }
}
